/**
 * 
 */
package com.buss.core.sysparam;

import java.util.HashMap;
import java.util.Map;

import com.buss.core.validator.ResultMessage;

/**
 * 系统静态参数
 * @author 高小勇
 * 创建时间:2011-5-2
 * wcms2.0
 */
public class SysStaticParam {

	/**存放在request中的返回信息键*/
	public final static String RESULT_MESSAGE = "_BS_MESSAGE";
	
	/**登录用户存放在session中的键*/
	public final static String SESSION_USER = "_BS_USER";
	
	/**当前店铺信息存放在session中的键*/
	public final static String SESSION_BRANCH = "_SESSION_BRANCH";
	
	/**返回页面消息名称*/
	public final static String _MESSAGE = "message";
	
	/**返回页面类容名称*/
	public final static String _RESULT = "result";
	
	/**返回消息成功键值*/
	public final static String _RESULT_SUCCESS = "0";
	
	public final static String _MENUID_NAME = "menuid";
	
	/**操作失败*/
	public final static String _RESULT_ERROR = "-1";
	/**
	 * 返回成功消息到页面
	 * @param mess
	 * @return
	 */
	public static Map<String, Object> resultMessage(String mess){
		Map<String,Object> map = new HashMap<String, Object>();
		map.put(_MESSAGE, new ResultMessage(_RESULT_SUCCESS, mess));
		return map;
	}
	
	public static Map<String,Object> resultMessage(String code,String mess){
		Map<String,Object> map = new HashMap<String, Object>();
		map.put(_MESSAGE, new ResultMessage(code, mess));
		return map;
	}
	
	public static ResultMessage resultMessageSuccess(String message){
		return new ResultMessage(_RESULT_SUCCESS, message);
	}
	
	public static ResultMessage resultMessageFailure(String message){
		return new ResultMessage(_RESULT_ERROR, message);
	}
}
